﻿<!DOCTYPE html >
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Random Dungeon Generator v1.0.3</title>
    <script type="text/javascript">
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // this is a completely self-contained random dungeon generator,
        // implemented in HTML5 and JavaScript.
        //
        //   version 1.0.3      updated save_canvas to use filename
        //   version 1.0.2      linked to generator.js version 2.0
        //   version 1.0.1      cache set_pixel() for performance
        //   version 1.0        initial release
        //
        // written by drow [drow@bin.sh]
        // http://creativecommons.org/licenses/by-nc/3.0/

        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    </script>
    <link rel="stylesheet" type="text/css" href="css/dungeon.css" />
    <link rel="manifest" href='data:text/plain,{"short_name":"Dungeon","name":"DFRPG Random Dungeon Generator","icons":[{"src":"images/icons-192.png","type":"image/png","sizes":"192x192"},{"src":"images/icons-512.png","type":"image/png","sizes":"512x512"}],"default_locale":"en","description":"Generates dungeons with statistics for GURPS DF and DFRPG","start_url":".","background_color":"#FFF","display":"standalone","theme_color":"#FFF"}'>
    <link rel="icon" href="images/icons-192.png">
    <link href="https://unpkg.com/vis@4.21.0/dist/vis.css" type="text/css" />
    <meta name="theme-color" content="#E7B546"> <!-- SJG website's distinctive color... -->
    <script type="text/javascript" src="lib/PrototypeJS.js"></script>
    <script src="https://unpkg.com/delaunator@3.0.2/delaunator.min.js"></script> <!-- minified build -->
    <script src="https://unpkg.com/js-graph-algorithms@1.0.18/build/jsgraphs.min.js"></script> <!-- minified build -->
    <script src="https://unpkg.com/vis@4.21.0/dist/vis.min.js"></script> <!-- minified build -->
</head>
<body>
    <img src="images/crosshatch.png" id="hatching" width="0" height="0" />
    <form method="get" onsubmit="return false;">
        <h1>Random Dungeon Generator</h1>
        <table id="form" class="center">
            <tr>
                <td class="key">Dungeon Name:</td>
                <td colspan="5" class="value"><input id="dungeon_name" size="60" /> &nbsp; <input type="button" id="new_name" value="New" /> </td>
            </tr>
            <tr>
                <td class="key">Dungeon Size:</td>
                <td class="value"><select id="dungeon_size"></select></td>
                <td class="key">Grid:</td>
                <td class="value"><select id="grid"></select></td>
                <td class="key">Party CER</td>
                <td class="value"><input id="cer" value="100" /></td>
            </tr>
            <tr>
                <td class="key">Dungeon Layout:</td>
                <td class="value"><select id="dungeon_layout"></select></td>
                <td class="key">Map Style:</td>
                <td class="value"><select id="map_style"></select></td>
                <td class="key">Monster Challenge:</td>
                <td class="value"><select id="challenge"></select></td>
            </tr>
            <tr>
                <td class="key">Room Layout:</td>
                <td class="value"><select id="room_layout"></select></td>
                <td class="key">Corridors:</td>
                <td class="value"><select id="corridor_layout"></select></td>
                <td class="key">Generosity:</td>
                <td class="value"><select id="generosity"></select></td>
            </tr>
            <tr>
                <td class="key">Room Size:</td>
                <td class="value"><select id="room_size"></select></td>
                <td class="key">Trim deadends?</td>
                <td class="value"><select id="remove_deadends"></select></td>
                <td class="key">Travel time:</td>
                <td class="value"><select id="travel_distance"></select></td>
            </tr>
            <tr>
                <td class="key">Stairs?</td>
                <td class="value"><select id="add_stairs"></select></td>
                <td class="key">Doors:</td>
                <td class="value"><select id="doors"></select></td>
                <td class="key"></td>
                <td class="value"></td>
            </tr>
            <tr>
                <td colspan="6"><div class="center">Link <a id="self_link">to re-create this dungeon</a></div></td>
            </tr>
            <tr>
                <td colspan="6" style="background: #dedede;">
                    <div class="center">
                        <input type="button" value="Save as PNG" onclick="save_map();" />
                        &nbsp; <input type="button" value="Print" onclick="do_print();" />
                        <span class="key">Px Per Yard:</span>
                        <span class="value"><input id="Resolution" value="50" style="width:3em;" /></span>
                    </div>
                    <div class="center">
                        <input type="checkbox" name="remote_treasure" id="remote_treasure" onclick="remote_reaction();" /> <label for="remote_treasure">Use remote treasure service?</label>
                        <p id="remote_treasure_notice">Remote treasure service disabled</p>
                    </div>
                </td>
            </tr>
        </table>
    </form>
    <script>
        /**
         * Update the link to this dungeon to be current
         */
        function update_self_link() {

            var options = {};
            $H(dungeon_options).keys().each(function (field) {
                if ($(field) != null) {
                    var value = $(field).getValue();
                    options[field] = value;
                }
            }
            );
            options['seed'] = $("dungeon_name").getValue();
            options['resolution'] = $("Resolution").getValue() || 25;
            var serial = GET_serialize(options);
            const newLocal = window.location.href;


            document.getElementById("self_link").setAttribute("href", newLocal.split('?')[0] + '?' + serial);

        }
        update_self_link();
    </script>
    <div class="center">
        <div class="page">
            <h1 id="dungeon_title" class="title"></h1>
            <canvas id="map" width="1" height="1">Your web browser does not appear to support the HTML5 &lt;canvas&gt; element.</canvas>
            <canvas id="playermap" width="1" height="1" class="hidden">Your web browser does not appear to support the HTML5 &lt;canvas&gt; element.</canvas>
            <p><img src="" alt="Key of map icons" /></p>
            <div>
                <input type="button" value="GM/Player map" onclick="swap_map();" />
            </div>
        </div>
        <div class="dungeon">
            <h1>Dungeon Key</h1>
            <div id="dungeon_key" class="rooms">
            </div>
        </div>
        <div class="encounters" alt="Description of each room">
            <h1>Room Key</h1>
            <div id="room_key" class="rooms">
            </div>
        </div>
        <p>Original Random Dungeon Generator<br />http://donjon.bin.sh/</p>
    </div>
    <script type="text/javascript" src="lib/treasure_service.js"></script>
    <script type="text/javascript" src="data/archesList.js"></script>
    <script type="text/javascript" src="data/atmospheres.js"></script>
    <script type="text/javascript" src="data/biomes.js"></script>
    <script type="text/javascript" src="data/ceilings.js"></script>
    <script type="text/javascript" src="data/concealment.js"></script>
    <script type="text/javascript" src="data/currency.js"></script>
    <script type="text/javascript" src="data/decorationNumber.js"></script>
    <script type="text/javascript" src="data/decorations.js"></script>
    <script type="text/javascript" src="data/doorsList.js"></script>
    <script type="text/javascript" src="data/dungeonLighting.js"></script>
    <script type="text/javascript" src="data/features.js"></script>
    <script type="text/javascript" src="data/water.js"></script>
    <script type="text/javascript" src="data/manaLevels.js"></script>
    <script type="text/javascript" src="data/monsters.js"></script>
    <script type="text/javascript" src="data/poison.js"></script>
    <script type="text/javascript" src="data/portcullisesList.js"></script>
    <script type="text/javascript" src="data/roomLighting.js"></script>
    <script type="text/javascript" src="data/sizeArea.js"></script>
    <script type="text/javascript" src="data/smells.js"></script>
    <script type="text/javascript" src="data/smellsNumber.js"></script>
    <script type="text/javascript" src="data/springs.js"></script>
    <script type="text/javascript" src="data/stuckDoorsList.js"></script>
    <script type="text/javascript" src="data/threatDistribution.js"></script>
    <script type="text/javascript" src="data/traps.js"></script>
    <script type="text/javascript" src="data/travel_times.js"></script>
    <script type="text/javascript" src="data/treasure.js"></script>
    <script type="text/javascript" src="lib/prng.js"></script>
    <script type="text/javascript" src="lib/dice.js"></script>
    <script type="text/javascript" src="lib/generator.js"></script>
    <script type="text/javascript" src="lib/name.js"></script>
    <script type="text/javascript" src="lib/gen_data.js"></script>
    <script type="text/javascript" src="lib/name_set.js"></script>
    <script type="text/javascript" src="lib/canvas.js"></script>
    <script type="text/javascript" src="lib/dungeon_types.js"></script>
    <script type="text/javascript" src="lib/CER_encounter.js"></script>
    <script type="text/javascript" src="lib/travel_environment.js"></script>
    <script type="text/javascript" src="lib/linkify.min.js"></script>
    <script type="text/javascript" src="lib/linkify-string.min.js"></script>
    <script type="text/javascript" src="lib/spanning_tree.js"></script>
    <script type="text/javascript" src="lib/dungeon.js"></script>

    <!--<div id="mynetwork"></div>-->
    <p id="selection"></p>
    <div id="debug"></div>
</body>
</html>
